package com.tz.fruit.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 类别实体类
 */
//水果礼篮,充值券卡,组合套餐,水果礼盒,香蕉,桔柑类,火龙果,凤梨,梨,瓜类,枣,果园周边,苹果,椰子,奇异果,
//葡萄提子,百香果,番茄,橙子,柚子,柠檬,芒果,草莓,蓝莓,樱桃,杨梅,桃子,杏子李子,荔枝,牛油果,西梅,山竹,
//
//调味配菜,粮油速食,虾蟹,贝类,禽蛋,水产丶鱼类,即食刺身,根茎类,瓜果类,茄蔬类,冷冻面点,牛肉,菌菇类,豆类,奶类,和牛,饮品,坚果类

@Entity
@Table(name="FRUIT_CATEGORY")
public class Category implements Serializable{
	private Long categoryId; //类别ID

	private String categoryNo;	//类别编号
	private String categoryName; //类编名称
	
	public Category() {
	}

	public Category(String categoryNo, String categoryName) {
		super();
		this.categoryNo = categoryNo;
		this.categoryName = categoryName;
	}
	
	@Id
	@GeneratedValue
	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	@Column(nullable=false,unique=true)
	public String getCategoryNo() {
		return categoryNo;
	}

	public void setCategoryNo(String categoryNo) {
		this.categoryNo = categoryNo;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((categoryId == null) ? 0 : categoryId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Category other = (Category) obj;
		if (categoryId == null) {
			if (other.categoryId != null)
				return false;
		} else if (!categoryId.equals(other.categoryId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Category [categoryId=" + categoryId + ", categoryNo=" + categoryNo + ", categoryName=" + categoryName
				+ "]";
	}
	
}
